#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2018/1/23 0023 14:03
# @Author  : Arliki
# @email   : hkdnxycz@outlook.com
# @File    : email_t

import smtplib
from email.mime.text import MIMEText
from email.header import Header


def run():
    from_addr = '18437958356@163.com'
    passwd = 'cz9277'
    to_addr = '2335434609@qq.com'
    smtp_server = 'smtp.163.com'
    msg = MIMEText('我也不知道这是什么奇葩的原因我也不知道这是什么奇葩的原因', 'plain', 'utf-8')
    msg['From'] = Header('一个神奇的地方', 'utf-8')
    msg['To'] = Header(to_addr, 'utf-8')
    msg['Subject'] = Header('Python SMTP 邮件', 'utf-8')
    server = smtplib.SMTP()
    server.connect(smtp_server, 25)
    server.set_debuglevel(1)
    server.login(from_addr, passwd)
    server.sendmail(from_addr, to_addr, msg.as_string())
    server.quit()


if __name__ == '__main__':
    import os

    print(os.getcwd())
